package com.yjd.comm.enums;

/**
 * Created by yangchangyan on 2017/6/28.
 */
public enum OrderStatusEnum {

    INIT(0, "待处理"),
    SUCCESS(1, "处理成功"),
    FAIL(2, "处理失败")
    ;

    private int code;
    private String label;

    public static OrderStatusEnum parse(int code) {
        for (OrderStatusEnum v : OrderStatusEnum.values()) {
            if (v.getCode() == code) {
                return v;
            }
        }
        return null;
    }

    private OrderStatusEnum(int code, String label) {
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}
